class TipoAttrezzo < ActiveRecord::Base
  acts_as_paranoid unless SHOW_DELETED
  has_many :attrezzi, :dependent => :protect
  has_and_belongs_to_many :rapporti_giornalieri, :join_table => 'rapporti_giornalieri_tipi_attrezzo', :uniq => true, :class_name => 'RapportoGiornaliero'
  
  validates_presence_of :name
  validates_uniqueness_of :name, :scope => :deleted_at, :case_sensitive => false
end
